package com.bridge.dao;

import com.bridge.entity.Brand;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author bridge
 * @Date 2022/06/16/21:11
 */
@Mapper
public interface BrandDao {

    List<Brand> findBrands(String name);


    int insertBrand(Brand brand);


    @Delete("delete from tb_brand where id=#{id}")
    int deleteById(Integer id);

    @Select("select * from tb_brand where id=#{id}")
    Brand findById(Integer id);

    @Update("update tb_brand set name=#{name},remark=#{remark} where id=#{id}")
    int updateBrand(Brand Brand);

    List<Brand> queryList();
}
